from fastapi import APIRouter, Request
from src.utils.response import ApiResponse
from src.utils.timehelper import TimeHelper
from .auth import get_current_user
from .base import RouterMeta
from src.schemas.health import HealthCheckResponse, HealthCheckData


router = APIRouter()


@router.get("/health_check",response_model=HealthCheckResponse,name="服务健康检查")
async def health_check(request: Request):
    """
    健康检查接口
    """
    await get_current_user(request)
    health_data = HealthCheckData(
        status="ok",
        version="1.0",
        timestamp=TimeHelper.milliseconds()
    )
    return ApiResponse.success(
        health_data,
        message="服务运行正常"
    )
# 路由元数据配置
meta = RouterMeta(
    router=router,
    prefix="/health",
    tags=["服务"]
)


